﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class Module_TinNgang : PanelControl
{
    FlightBusiness fb = new FlightBusiness();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public string getFlightInDay()
    {
        string day, month, year,tmp="";
        day = DateTime.Now.Day.ToString();
        month = DateTime.Now.Month.ToString();
        year = DateTime.Now.Year.ToString();
        string currentDay = day + "/" + month + "/" + year;
        Convert.ToDateTime(currentDay);
        SqlDataReader read = fb.getFlightInDay((Convert.ToDateTime(currentDay)).ToShortDateString());
        if (read.HasRows)
        {
            while (read.Read())
            {
                tmp += "<tr id=" + "trFlight" + " align=center>";
                tmp += "<td>" + read["flightID"] + "</td>";
                tmp += "<td>" + read["departure"] + "</td>";
                tmp += "<td>" + read["arrival"] + "</td>";
                tmp += "<td>" + read["startTime"] + "</td>";
                tmp += "<td>" + read["promotionsName"] + "</td>";
                tmp += "<td>" + read["price"] + "</td>";
                tmp += "<td><a href='Default.aspx?url=Module/DetailFlightIn.ascx&flightID=" + read["flightID"] + "'>" + "Chi Tiết" + "</a></td>";
                tmp += "</tr>";
            }
        }
        return tmp;
    }
}